// & 交叉类型
// | => ||
// & => &&

// | 并集
// & 交集 ts中的交叉的部分

interface Person1 {
    handsome: string,
    n: {
        n: number
    }
}

interface Person2 {
    high: string,
    n: {
        b: string
    }
}

interface Person4 {
    rich: string
}

type Person3 = Person1 & Person2 & Person4;

let person:Person3 = {
    handsome: "啊是",
    high: "啊是",
    rich: "啊是",
    n: {
        n: 1,
        b: '2'
    }
}

function mixin<T, K>(o1: T, o2: K) {
    return {...o1, ...o2}
}
let r = mixin({a: "abc"}, {a: 1});

type IMixin = typeof r;
type Ival = IMixin["a"]; // 交叉类型出现never

type a = ("number" | "string") & {}
export {}